package com.lzy.pattern.composite;

/**
 * @ClassName: MenuComponent
 * @Description: 抽象根节点（Component）：定义系统各层次对象的共有方法和属性，可以预先定义一些默认行为和属性。
 * @Author: LiuZy
 * @Date: 2022/4/25 08:33
 * @Version: 1.0
 */
public abstract class MenuComponent {

    protected String name;
    protected Integer level;

    public void add(MenuComponent component){
        throw new UnsupportedOperationException();
    }

    public void addAll(MenuComponent... component){
        throw new UnsupportedOperationException();
    }

    public void remove(MenuComponent component){
        throw new UnsupportedOperationException();
    }

    public MenuComponent getChild(int index){
        throw new UnsupportedOperationException();
    }

    public String getName(){
        return name;
    }

    public abstract void print();
}